package com.good.shopping.ware.feign;

import com.good.common.base.ServiceConstant;
import com.good.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 远程调用
 * @author shengren.yan
 * @create 2022-02-14
 */
//@FeignClient(value = "shopping-product")
@FeignClient(value = ServiceConstant.SERVICE_PRODUCT_NAME)
public interface ProductFeignService {

    String API_PREFIX = "/product";

    /**
     *      /product/skuinfo/info/{skuId}
     *
     *   1)、让所有请求过网关；
     *          1、@FeignClient("shopping-gateway")：
     *          2、/api/product/skuinfo/info/{skuId}
     *   2）、直接让后台指定服务处理
     *          1、@FeignClient("shopping-product")
     *          2、/product/skuinfo/info/{skuId}
     *
     * @return
     */
    @RequestMapping(API_PREFIX + "/skuinfo/info/{skuId}")
    public R info(@PathVariable("skuId") Long skuId);

}
